<template>
  <div>
    <!-- <coma /> -->
    <keep-alive>
      <component :is="cname"></component>
    </keep-alive>
    <button @click="cname = 'comb'">点我修改组件</button>
  </div>
</template>

<script lang="ts">
import coma from './coma.vue'
import comb from './comb.vue'
export default {
  components: {
    coma,
    comb
  },
  data() {
    return {
      cname: 'coma'
    }
  }
}
</script>

<!-- <script setup>
function fn(a, b, ...arg) {
  console.log(a + b)
  // 以前获取可变参数的方法, 传入的实参如果没有被接收, 通过 arguments 也可以获取
  // console.log(arguments) 
  console.log(arg) // 可变参数
}
fn(1, 2, 3, 4, 5, 6)
fn(1, 2, 3)
</script> -->

<style scoped>

</style>